<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
	</head>
	<body>
		<div class="b"></div>
		<div class="b"></div>
		<div class="b"></div>
		<div class="b"></div>
		<div class="b"></div>
		<div class="b"></div> 
		
		<script type="text/javascript">
			var b = document.getElementsByClassName('b');
			var timego = new Date('2020 10-14 20:00');
			
			var count_times = setInterval(function(){
				var loacaltime = new Date();
				var times = timego - loacaltime;
				
				 var hao = (times % 1000);
				 var sec = parseInt(times / 1000);
				 var sescth = (sec % 60);
				 var min = parseInt((sec / 60)) % 60;
				
				var hour = parseInt((sec / 3600)) % 24;
				var days = parseInt((sec / 86400)) % 365;
				b[0].innerHTML = days + '天';
				b[1].innerHTML = hour + '时';
				b[2].innerHTML = min + '分';
				b[3].innerHTML = sescth + '秒';
				
				var res = '';
				if(hao < 10){
					res = '00' + hao;
				}else if(hao >= 10 && hao < 100){
					res = '0' + hao;
				}else{
				    res = hao;
				}
				b[4].innerHTML = res + '毫秒';
			},1)
		</script>
	</body>
</html>
